<?php


namespace app\home\controller;


use think\facade\View;

class Category
{
    /**
     * 使所有子类都自带显示分类菜单
     * Category constructor.
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function __construct()
    {
       $data= \app\common\model\Category::select()->toArray();
       $data=types($data);
       View::assign('category',$data);
    }
}